<?php

// 店铺端控制台

namespace app\client\controller;

use think\Db;
use think\Session;
use think\Controller;

class Dashboard extends Controller
{

    /**
     * 店铺端控制台
     * @return mixed
     */
    public function index()
    {

        Db::view('member_order', 'id,member_id,shop_id,shop_order_number,status,create_time')
            ->view('member', 'id as member_id,username', 'member.id = member_order.member_id')
            ->where(['shop_id' => Session::get('shop_id')])
            ->order(['member_order.id' => 'desc'])->limit('6')->cache('index_order_list_' . Session::get('shop_id'), 300)->select();


        return $this->fetch('index', [
            "mate_title" => '控制台'
        ]);
    }
}
